﻿//-----------------------------------------------------------------------
// <copyright file="SmartManipulatorSettings.cs" company="Nathan Miller">
// Copyright (c) Nathan Miller.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
// 
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </copyright>
//-----------------------------------------------------------------------
namespace TileTool.Base.Manipulator.Smart
{
    using TileTool.Common.Math;
    using TileTool.Settings;

    /// <summary>
    /// Smart manipulator settings.
    /// </summary>
    public class SmartManipulatorSettings : SettingsBase
    {
        #region Fields - Private

        /// <summary>
        /// Size circle radius
        /// </summary>
        private float sizeCircleRadius;

        /// <summary>
        /// Amount to offset our rotate circle vertically.
        /// </summary>
        private float rotateCircleOffset;

        /// <summary>
        /// Rotate circle radius
        /// </summary>
        private float rotateCircleRadius;

        /// <summary>
        /// Rotate center circle radius
        /// </summary>
        private float rotateCenterCircleRadius;

        /// <summary>
        /// Amount to offset our translate toggle circle vertically.
        /// </summary>
        private float translateToogleCircleOffset;

        #endregion

        #region Properties - Public

        /// <summary>
        /// Gets or sets the color to draw the size circles with.
        /// </summary>
        [SettingsDefaultValue(0, 0, 128, 164)]
        public ColorRGBA SizeCircleColor
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the color to draw the selected size circle with.
        /// </summary>
        [SettingsDefaultValue(0, 0, 255, 255)]
        public ColorRGBA SizeCircleSelectedColor
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the size circle radius.
        /// </summary>
        [SettingsDefaultValue(8.0f, 4.0f, 32.0f)]
        public float SizeCircleRadius
        {
            get
            {
                return this.sizeCircleRadius;
            }

            set
            {
                this.sizeCircleRadius = this.Clamp(value);
            }
        }

        /// <summary>
        /// Gets or sets the rotate circle radius.
        /// </summary>
        [SettingsDefaultValue(8.0f, 4.0f, 32.0f)]
        public float RotateCircleRadius
        {
            get
            {
                return this.rotateCircleRadius;
            }

            set
            {
                this.rotateCircleRadius = this.Clamp(value);
            }
        }

        /// <summary>
        /// Gets or sets the rotate circle offset.
        /// </summary>
        [SettingsDefaultValue(16.0f, 8.0f, 64.0f)]
        public float RotateCircleOffset
        {
            get
            {
                return this.rotateCircleOffset;
            }

            set
            {
                this.rotateCircleOffset = this.Clamp(value);
            }
        }

        /// <summary>
        /// Gets or sets the color to draw the rotate circle with.
        /// </summary>
        [SettingsDefaultValue(0, 128, 0, 164)]
        public ColorRGBA RotateCircleColor
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the color to draw the rotate circle with.
        /// </summary>
        [SettingsDefaultValue(0, 255, 0, 255)]
        public ColorRGBA RotateCircleSelectedColor
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the rotate center circle radius.
        /// </summary>
        [SettingsDefaultValue(8.0f, 4.0f, 32.0f)]
        public float RotateCenterCircleRadius
        {
            get
            {
                return this.rotateCenterCircleRadius;
            }

            set
            {
                this.rotateCenterCircleRadius = this.Clamp(value);
            }
        }

        /// <summary>
        /// Gets or sets the color to draw the rotate center circle with.
        /// </summary>
        [SettingsDefaultValue(85, 107, 47, 164)]
        public ColorRGBA RotateCenterCircleColor
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the color to draw the rotate center circle with.
        /// </summary>
        [SettingsDefaultValue(0, 255, 0, 255)]
        public ColorRGBA RotateCenterCircleSelectedColor
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the translate toggle circle offset.
        /// </summary>
        [SettingsDefaultValue(16.0f, 8.0f, 64.0f)]
        public float TranslateToggleCircleOffset
        {
            get
            {
                return this.translateToogleCircleOffset;
            }

            set
            {
                this.translateToogleCircleOffset = this.Clamp(value);
            }
        }

        /// <summary>
        /// Gets or sets the color to draw the translate toggle with.
        /// </summary>
        [SettingsDefaultValue(128, 0, 0, 164)]
        public ColorRGBA TranslateToggleColor
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the color to draw the translate toggle with.
        /// </summary>
        [SettingsDefaultValue(255, 0, 0, 255)]
        public ColorRGBA TranslateToggleSelectedColor
        {
            get;
            set;
        }

        #endregion
    }
}
